/*
 * JFrameSplash.java
 * Classe que inicia a tela de Splash do Bier Manager
 */

package biermanager.interfaceGrafica;

import java.awt.Dimension;
import java.awt.Toolkit;
import java.util.Timer;
import java.util.TimerTask;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.SwingUtilities;
import javax.swing.UIManager;

/**
 *
 * @author  Tiago Silva Loureiro
 */
public class JFrameSplash extends javax.swing.JFrame {
   
    /** Cria uma tela de splash JFrameSplash */
    public JFrameSplash() {
        initComponents();
        setLookAndFeel();
        Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();  
        setLocation( (int)( ( screenSize.getWidth() - this.getWidth() ) / 2 ), (int)( (screenSize.getHeight() - this.getHeight() - 40) / 2 ) );

    }
    

    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel2 = new javax.swing.JPanel();
        jlblFraseBottom = new javax.swing.JLabel();
        jlblTitulo = new javax.swing.JLabel();
        jlblLicensa = new javax.swing.JLabel();
        jProgressBar1 = new javax.swing.JProgressBar();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        setTitle("Bier Manager");
        setName("TelaDeSplash"); // NOI18N
        setUndecorated(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowOpened(java.awt.event.WindowEvent evt) {
                formWindowOpened(evt);
            }
        });

        jPanel1.setBackground(new java.awt.Color(8, 0, 47));

        jPanel2.setBackground(new java.awt.Color(0, 0, 51));
        jPanel2.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jlblFraseBottom.setFont(new java.awt.Font("Georgia", 1, 14));
        jlblFraseBottom.setForeground(new java.awt.Color(240, 240, 240));
        jlblFraseBottom.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlblFraseBottom.setText("Bier Manager - The Best Futsal Management Game in the World");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlblFraseBottom, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jlblFraseBottom)
        );

        jlblTitulo.setFont(new java.awt.Font("Arial Black", 0, 18));
        jlblTitulo.setForeground(new java.awt.Color(240, 240, 240));
        jlblTitulo.setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
        jlblTitulo.setText("Bier Futsal Manager");

        jlblLicensa.setBackground(new java.awt.Color(0, 0, 51));
        jlblLicensa.setFont(new java.awt.Font("Georgia", 0, 12));
        jlblLicensa.setForeground(new java.awt.Color(255, 255, 255));
        jlblLicensa.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jlblLicensa.setText("<html>\nBier Manager is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or any later version.\n<br>\n<br>\n<br>\n\nBier Manager é software livre, licenciado pelos termos da GNU GPL publicada pela Free Software Foundation.\nPara reportar bugs, informações, documentação acesse:\n<br>\nhttp://bmanager.sourceforge.net\n</html>");
        jlblLicensa.setVerticalAlignment(javax.swing.SwingConstants.TOP);
        jlblLicensa.setBorder(javax.swing.BorderFactory.createBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jlblLicensa.setEnabled(false);
        jlblLicensa.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
        jlblLicensa.setOpaque(true);

        jProgressBar1.setIndeterminate(true);
        jProgressBar1.setOpaque(true);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jlblTitulo)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jProgressBar1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jlblLicensa, javax.swing.GroupLayout.DEFAULT_SIZE, 214, Short.MAX_VALUE))))
                .addGap(58, 58, 58))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jlblTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jlblLicensa, javax.swing.GroupLayout.PREFERRED_SIZE, 221, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jProgressBar1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(17, 17, 17))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 517, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened

}//GEN-LAST:event_formWindowOpened


    private void setLookAndFeel() {
    try {
        UIManager.setLookAndFeel( UIManager.getSystemLookAndFeelClassName() );
        SwingUtilities.updateComponentTreeUI(this);
    }catch ( Exception e ) {
        System.err.println( "Nao é possivel usar a Aparência do Sistema:" + e );
    }
}
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JProgressBar jProgressBar1;
    private javax.swing.JLabel jlblFraseBottom;
    private javax.swing.JLabel jlblLicensa;
    private javax.swing.JLabel jlblTitulo;
    // End of variables declaration//GEN-END:variables

}
